home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -seriously_amiga- / sound / ahi / developer / filesave / studio16file.h < prev   
C/C++ Source or Header  |  1998-07-16  |  2KB  |  94 lines

  1. #ifndef STUDIO16FILE_H
  2. #define STUDIO16FILE_H
  3.  
  4. /*
  5. **    $VER: Studio16fileformat 2.0 (9.11.97)
  6. **
  7. **    The STUDIO16_2.0 format (KWK3)
  8. **
  9. **    Analysed by Kenneth "Kenny" Nilsen
  10. **    mailto:kenny@bgnett.no
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. /* Initializers */
  18.  
  19. #define S16FID        0x4B574B33  /* "KWK3" */
  20. #define S16FINIT    0x1
  21.  
  22. /* File header structure
  23. *
  24. *  HEADER  (3690)
  25. *  SAMPLES (samples x 16bit)
  26. */
  27.  
  28. #define    S16FILEHEADERSIZE    3690
  29.  
  30. /* I am no C programmer so please let me know if this one is incorrect: */
  31.  
  32. struct STUDIO16FILE
  33. {
  34.     ULONG    S16F_ID;        /* FILE HEADER ID (K16FID) */
  35.     ULONG    S16F_RATE;        /* sample rate */
  36.     ULONG    S16F_FILTER;        /* Init with $1 (K16FINIT) */
  37.     UWORD    S16F_VOLUME;        /* sample volume */
  38.     ULONG    S16F_SMPTE;        /* SMPTE timecode (H:B M:B S:B F:B) */
  39.     ULONG    S16F_SMPTEFLOAT;    /* SMPTE sampling rate */
  40.     ULONG    S16F_PAN;        /* pan setting */
  41.     LONG    S16F_FLAGS;        /* misc flags */
  42.     LONG    S16F_RESERVED;
  43.  
  44. /* here follows the sampleclips */
  45.  
  46.     ULONG    S16F_SAMPLES0;        /* number of samples (bytesize/2) */
  47.     ULONG    S16F_SAMPLES1;        /* number of samples */
  48.     ULONG    S16F_0;            /* start of first range [main] */
  49.     ULONG    S16F_SAMPLES2;        /* number of samples-1  (end) */
  50.     ULONG    S16F_EDITSTATUS;    /* if =null then no edits in file */
  51.     char    S16F_1[3636];
  52. /*    LABEL    S16F_SIZEOF    */    /* =3690 */
  53. };
  54.  
  55. /* Sample rates for Studio 16: */
  56.  
  57. #define    S16_FREQ_0    0x1589    /* 5513 hz */
  58. #define    S16_FREQ_1    0x19D7    /* 6615 hz */
  59. #define    S16_FREQ_2    0x1F40    /* 8000 hz */
  60. #define    S16_FREQ_3    0x2580    /* 9600 hz */
  61. #define    S16_FREQ_4    0x2B11    /* 11025 hz */
  62. #define    S16_FREQ_5    0x3e80    /* 16000 hz */
  63. #define    S16_FREQ_6    0x49D4    /* 18900 hz */
  64. #define    S16_FREQ_7    0x5622    /* 22050 hz */
  65. #define    S16_FREQ_8    0x6B25    /* 27429 hz */
  66. #define    S16_FREQ_9    0x7D00    /* 32000 hz */
  67. #define    S16_FREQ_A    0x8133    /* 33075 hz */
  68. #define    S16_FREQ_B    0x93A8    /* 37800 hz */
  69. #define    S16_FREQ_C    0xAC44    /* 44100 hz */
  70. #define    S16_FREQ_D    0xBB80    /* 48000 hz */
  71.  
  72. /* Volumes */
  73.  
  74. #define    S16_VOL_6    0xD40    /* +6 dB */
  75. #define    S16_VOL_0    0xC80    /* +0 dB */
  76. #define    S16_VOL_40    0x780    /* Decibel = number-100 */
  77. #define    S16_VOL_OFF    0    /* oo dB */
  78.  
  79. #define    S16_VOL_STEPS    0x20
  80.  
  81. /* Pans */
  82.  
  83. #define    S16_PAN_LEFT    0x0
  84. #define    S16_PAN_MID    0xc80
  85. #define    S16_PAN_RIGHT    0x1900
  86.  
  87. #define    S16_PAN_STEPS    0x20
  88.  
  89. /* NOTE: Fileclips and regions are not defined here!
  90. *  Make sure to convert edits to permanent before converting a sample
  91. *  FROM Studio16_2.0 to something else. */
  92.  
  93. #endif /* STUDIO16FILE_H */
  94.